<!-- templates/base.html -->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>{% block title %}交易平台{% endblock %}</title>
    <link rel="stylesheet" type="text/css" href="/static/css/bootstrap.min.css">
    <link rel="stylesheet" href="/static/css/style.css">
    {% block extra_head %}{% endblock %}
</head>
<body>
    <header class="nav_head">
        <div class="container">
            {% if request.user.is_authenticated %}
                <p>欢迎您，{{ request.user.username }}</p>
                <button class="btn btn-default"><a href="{% url 'user:logout' %}">退出</a></button>
            {% else %}
                <a class="btn btn-link" href="{% url 'user:login' %}">登录</a>
                <a class="btn btn-link" href="{% url 'user:register' %}">注册</a>
            {% endif %}
            <nav>
                <a class="btn btn-link" href="{% url 'user:user_center' %}">用户中心</a>
                <a class="btn btn-link" href="/">首页</a>
            </nav>
        </div>
    </header>

    <main class="container">
        {% block content %}{% endblock %}
    </main>

    <footer class="foot text-center">
        <img src="/static/img/title2.png" alt="校园二手货口号">
        <p>来校园二手货，你的闲置能换钱！</p>
        <span>全国最大最活跃的校园闲置物品交换平台</span>
    </footer>

    {% include 'includes/websocket.html' %}
</body>
</html>